import React from 'react'

class PropsChildren extends React.Component {
    render() {
        return (
            <Parent>
                { (name: string) => (<h2>{name}</h2>)}
            </Parent>
        )
    }
}

class Parent extends React.Component<{ children: any }, any> {
    render() {
        return (
            <div>
                <h1>props children</h1>
                {this.props.children('name from parent')}
            </div>
        )
    }
}

export default PropsChildren;
